
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='login.css') }}">
</head>
<body>
    <div class="login-container">
        <h2>登录</h2>
        <form method="POST" action="{{ url_for('login') }}">
   
    {% if error %}
    <script>
        window.onload = function() {
            alert('{{ error }}');
        };
    </script>
    {% endif %}
    <div>
        <label for="username">用户名:</label>
        <input type="text" id="username" name="username" required>
    </div>
    <div>
        <label for="password">密码:</label>
        <div class="password-wrapper">
                <input type="password" id="password" name="password" required>
            </div>
    </div>
    <button type="submit">登录</button>
    <p class="auth-links">没有账号？<a href="/register">立即注册</a></p>
</form>
        </form>
    </div>
<script>
        function togglePasswordVisibility() {
            const passwordInput = document.getElementById('password');
            if (passwordInput.type === 'password') {
                passwordInput.type = 'text';
            } else {
                passwordInput.type = 'password';
            }
        }
        </script>
</body>
</html>